package com.jinhongone.pattern.behavior.state.after;

/**
 * @author jinho
 * @className RunningState
 * @description 具体状态角色-运行
 * @date 2025/4/16 14:50
 */
public class RunningState extends LiftState{
    @Override
    public void open() {

    }

    @Override
    public void close() {

    }

    @Override
    public void run() {
        System.out.println("电梯正在运行...");
    }

    @Override
    public void stop() {
        //设置环境对象状态变更
        super.getContext().setLiftState(Context.STOPPING_STATE);
        //通过环境对象进行电梯停止操作
        super.getContext().stop();
    }

}
